// 判断是安卓还是ios平板
function detect() {
    let equipmentType = "";
    let agent = navigator.userAgent.toLowerCase();
    
    let android = agent.indexOf("android");
    let iphoneIpad = agent.indexOf("safari");

    if (android != -1) {
        equipmentType = "android";
    } else if (iphoneIpad == -1) {  // 苹果电脑打开有safari，iphoneIpad 打开没有以此来区分
        equipmentType = "ios";
    } else {
        equipmentType = "pc";
    }

    return equipmentType;
}

// // 判断是否是ios和安坐
// function detectionFn() {
//     let isAndoidOrIos = detect();

//     if (isAndoidOrIos === "android" || isAndoidOrIos === "ios") {
//         //安卓平板和iPhone的平板
//         return "ipad"
//     } else {
//         // pc
//         return "pc"
//     }
// }

export default detect